package edu.hawaii.myisern.brown.model;

import static org.junit.Assert.assertEquals;
import org.junit.Test;

/**
 * Test for user class.
 * 
 * @author Randy Cox
 */
@SuppressWarnings("PMD.AvoidDuplicateLiterals")
public class TestUser {
  
  /**
   * Test aspects of User.
   */
  @Test
  public void testUserMethods() {
    User user = new User();
    user.setId(1);
    user.setUsername("Test Name");
    user.setPassword("Test Password");
    assertEquals("Test user", "Test Name", user.getUsername());
    assertEquals("Test pass", "Test Password", user.getPassword());
    Integer value = 1;
    assertEquals("Test id", value, user.getId());
    User user2 = new User("Test user","Test Name");
    user2.setId(1);
    assertEquals("Test hashcode", user.hashCode(), user2.hashCode());
  }
 }
